package 尊享面试.数组_字符串;

public class a392判断子序列 {

    static class Solution {
        public boolean isSubsequence(String s, String t) {
            int slen = s.length();
            int tlen = t.length();
            int i = 0;
            int j = 0;
            while (i < slen && j < tlen) {
                if(s.charAt(i) == t.charAt(j)){
                    i++;
                }
                j++;
            }
            return i == slen;
        }
    }

    public static void main(String[] args) {
        Solution solution = new Solution();
        String s = "", t = "ahbgdc";
        System.out.println(solution.isSubsequence(s, t));
    }
}
